package com.pearadmin.system.service.impl;

import java.util.List;
import java.util.ArrayList;

import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import com.pearadmin.common.web.domain.request.PageDomain;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.pearadmin.system.mapper.ReportEvaluationMethodMapper;
import com.pearadmin.system.domain.ReportEvaluationMethod;
import com.pearadmin.system.service.IReportEvaluationMethodService;

/**
 * 评价方法Service业务层处理
 * 
 * @author jmys
 * @date 2021-04-12
 */
@Service
public class ReportEvaluationMethodServiceImpl implements IReportEvaluationMethodService 
{
    @Autowired
    private ReportEvaluationMethodMapper reportEvaluationMethodMapper;

    /**
     * 查询评价方法
     * 
     * @param id 评价方法ID
     * @return 评价方法
     */
    @Override
    public ReportEvaluationMethod selectReportEvaluationMethodById(Long id)
    {
        return reportEvaluationMethodMapper.selectReportEvaluationMethodById(id);
    }

    /**
     * 查询评价方法列表
     * 
     * @param reportEvaluationMethod 评价方法
     * @return 评价方法
     */
    @Override
    public List<ReportEvaluationMethod> selectReportEvaluationMethodList(ReportEvaluationMethod reportEvaluationMethod)
    {
        return reportEvaluationMethodMapper.selectReportEvaluationMethodList(reportEvaluationMethod);
    }

    /**
     * 查询评价方法
     * @param reportEvaluationMethod 评价方法
     * @param pageDomain
     * @return 评价方法 分页集合
     * */
    @Override
    public PageInfo<ReportEvaluationMethod> selectReportEvaluationMethodPage(ReportEvaluationMethod reportEvaluationMethod, PageDomain pageDomain)
    {
        PageHelper.startPage(pageDomain.getPage(),pageDomain.getLimit());
        List<ReportEvaluationMethod> data = reportEvaluationMethodMapper.selectReportEvaluationMethodList(reportEvaluationMethod);
        return new PageInfo<>(data);
    }

    /**
     * 新增评价方法
     * 
     * @param reportEvaluationMethod 评价方法
     * @return 结果
     */

    @Override
    public int insertReportEvaluationMethod(ReportEvaluationMethod reportEvaluationMethod)
    {
        return reportEvaluationMethodMapper.insertReportEvaluationMethod(reportEvaluationMethod);
    }

    /**
     * 修改评价方法
     * 
     * @param reportEvaluationMethod 评价方法
     * @return 结果
     */
    @Override
    public int updateReportEvaluationMethod(ReportEvaluationMethod reportEvaluationMethod)
    {
        return reportEvaluationMethodMapper.updateReportEvaluationMethod(reportEvaluationMethod);
    }

    /**
     * 删除评价方法对象
     * 
     * @param ids 需要删除的数据ID
     * @return 结果
     */
    @Override
    public int deleteReportEvaluationMethodByIds(String[] ids)
    {
        return reportEvaluationMethodMapper.deleteReportEvaluationMethodByIds(ids);
    }

    /**
     * 删除评价方法信息
     * 
     * @param id 评价方法ID
     * @return 结果
     */
    @Override
    public int deleteReportEvaluationMethodById(Long id)
    {
        return reportEvaluationMethodMapper.deleteReportEvaluationMethodById(id);
    }
}
